char twinkle[] = 
{'c','c','g','g','a','a','g','0',
'f','f','e','e','d','d','c','0',
'g','g','f','f','e','e','d','0',
'g','g','f','f','e','e','d','0',
'c','c','g','g','a','a','g','0',
'f','f','e','e','d','d','c','0'}; 


float noteToFQ(char c)
{
	float retHZ = 100000;
	u8 fudgeFactor = 1;
	switch (c)
	{
	case 'c':
		retHZ = 523.3*fudgeFactor;break;
	case 'd':
		retHZ = 587.3*fudgeFactor;break;
	case 'e':
		retHZ = 659.3*fudgeFactor;break;
	case 'f':
		retHZ = 698.5*fudgeFactor;break;
	case 'g':
		retHZ = 784*fudgeFactor;break;
	case 'a':
		retHZ = 880*fudgeFactor;break;
	case 'b':
		retHZ = 987.8*fudgeFactor;break;
	case 'z':
		retHZ = 100000;break;
	default:
		break;
	}
	return retHZ;
}

void playSong(char song[], u16 delay)
{
	int i=0;
	u16 songLen = 48;

	for (i=0; i<songLen; i++)
	{
		initPWM(noteToFQ(song[i]));
		Delay(delay);
	}
}
